<?php  // get the view's language correct
	$language = $this->session->userdata('ua_language');
	if ( empty($language) ) {
		$language = $this->config->item('language'); 
		$this->session->set_userdata('ua_language', $language);
	}
	log_message('debug', 'Template: Mini_App Language: - '.$language);
	$this->lang->load('miniapp', $language);

	// set xml:lang
	$lang = 'ua_lang_'.$language;
	$lang = $this->config->item($lang);
	if( empty($lang) ) { $lang = 'en'; }

	// set the character set
	$charset = 'ua_charset_'.$language;
	$charset = $this->config->item($charset);
	if( empty($charset) ) { $charset = 'windows-1251'; }
	
	$html_title = 'Vortarista laborloko ';
	$html_title .= ( ! empty($title) ) ? " - ".$title : '';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$lang?>" lang="<?=$lang?>">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>" />
		
		<title><?=$html_title?></title>
		<link rel="shortcut icon" href="<?=base_url()?>img/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" type="text/css" href="<?=base_url()?>css/default.css" media="screen" />
	
		<!--// We like to use prototype.js //-->
		<script type="text/javascript" src="<?=base_url()?>js/prototype.js" ></script>
		<script type="text/javascript" src="<?=base_url()?>js/scriptaculous.js" ></script>
		<!--// Allow additional Head Content //-->
		<?php if (isset($extraHeadContent)) { echo $extraHeadContent; } ?>
	

	</head>

	<body> 

  <div id="wrapper">    
			<div id="header">
				<h1><?=$this->lang->line('ma_project_title');?></h1>
			</div><!--// End of header //-->
		
			<div id="container">
				<div id="content" class="column">
<?	if (isset($h1_title)):?>
					<h2><?=$h1_title?></h2>
<?	endif;?>

<?php

if ( ('search' == $this->uri->segment(1)) || (FALSE == $this->uri->segment(1)) ) {
  $this->load->view('pages/search');
} elseif( ('view') == $this->uri->segment(1) ) {
  $this->load->view('pages/view');
} elseif( ('edit') == $this->uri->segment(1) ) {
  $this->load->view('pages/edit');
} elseif( ('add') == $this->uri->segment(1) ) {
  $this->load->view('pages/add');
//} elseif( ('import') == $this->uri->segment(1) ) {
//  $this->load->view('pages/add');
} else {

	echo @$vortaro;
	echo @$content;
}
?>
				</div><!--// End of content //-->
				<div id="columnLeft" class="column">
<?
	if (!isset($nav)) { $nav = FALSE; }
	$this->load->view('app/menu', $nav);		// menu
	$this->load->view('usergroups/login');	//login box
?>
				</div><!--// End of columnLeft //-->
			</div><!--// End of container //-->
			<div id="footer">
					<div id="copyright">Vortarista laborloko &copy; 2008</div>
			</div><!--// End of footer //-->
		</div><!--// End of wrapper //-->
	</body>
</html>